#include "LcPanel.h"

// begin wxGlade: ::extracode

// end wxGlade


LcPanel::LcPanel(wxWindow* parent,
                 int id,
                 const wxPoint& pos,
                 const wxSize& size,
                 long style)
    : wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL|wxFULL_REPAINT_ON_RESIZE)
    , m_r(0)
    , m_g(0)
    , m_b(0)
{
    // begin wxGlade: LcPanel::LcPanel

    set_properties();
    do_layout();
    // end wxGlade
}


BEGIN_EVENT_TABLE(LcPanel, wxPanel)
    EVT_PAINT(LcPanel::OnPaint)
END_EVENT_TABLE();


void LcPanel::set_properties()
{
    // begin wxGlade: LcPanel::set_properties
    SetMinSize(wxSize(50, 150));
    SetBackgroundColour(wxColour(0, 0, 0));
    // end wxGlade
}


void LcPanel::do_layout()
{
    // begin wxGlade: LcPanel::do_layout
    // end wxGlade
}


void LcPanel::SetColor(int r, int g, int b)
{
    m_r = r;
    m_g = g;
    m_b = b;

    Refresh();
}


void LcPanel::OnPaint(wxPaintEvent& e)
{
    int w;
    int h;
    GetSize(&w, &h);

    wxPaintDC dc(this);
    wxGCDC gdc(dc);

    wxColour pen_color(64, 64, 64);
    dc.SetPen(wxPen(pen_color));

    wxColour color(m_r, m_g, m_b);
    dc.SetBrush(wxBrush(color));

    dc.DrawEllipse((w - LIGHT_W)/2, (h - LIGHT_H)/2, LIGHT_W, LIGHT_H);
}

